<template>
	<div class="person">
		<h2>我是Person组件</h2>
		<h3>名字：{{name}}，年龄：{{age}}</h3>
		<button @click="handleClick">把我的年龄给School组件</button>
	</div>
</template>

<script>
	export default {
		name:'Person',
		data() {
			return {
				name:'张三',
				age:18
			}
		},
		methods: {
			handleClick(){
				this.$bus.$emit('haha',this.age)
			}
		},
	}
</script>

<style scoped>
	.person{
		background-color: orange;
		padding: 20px;
	}
</style>